package engine.scheduler.jobs;

import org.quartz.JobDetail;
import org.springframework.beans.factory.annotation.Autowired;

import engine.dataobjects.MailItem;
import engine.services.IContentService;
import engine.services.IMailService;

public class MailItemJobDetail extends JobDetail implements IMailItemJobDetail {
	@Override
	public String toString() {
		return "MailItemJobDetail [mailService=" + mailService
				+ ", contentService=" + contentService + ", item=" + item
				+ ", getName()=" + getName() + ", getGroup()=" + getGroup()
				+ ", getFullName()=" + getFullName() + ", getKey()=" + getKey()
				+ ", getDescription()=" + getDescription() + "]";
	}

	@Autowired
	IMailService mailService;
	@Autowired
	IContentService contentService;
	
	MailItem item;
	
	/* (non-Javadoc)
	 * @see engine.scheduler.jobs.IMailItemJobDetilas#getItem()
	 */
	@Override
	public MailItem getItem() {
		return item;
	}

	/* (non-Javadoc)
	 * @see engine.scheduler.jobs.IMailItemJobDetilas#setItem(engine.dataobjects.Mailitem)
	 */
	@Override
	public void setItem(MailItem item) {
		this.item = item;
		this.setName(item.getId());
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/* (non-Javadoc)
	 * @see engine.scheduler.jobs.IMailItemJobDetilas#getMailService()
	 */
	@Override
	public IMailService getMailService() {
		return mailService;
	}


	public void setMailService(IMailService mailService) {
		this.mailService = mailService;
	}

	/* (non-Javadoc)
	 * @see engine.scheduler.jobs.IMailItemJobDetilas#getContentService()
	 */
	@Override
	public IContentService getContentService() {
		return contentService;
	}


	public void setContentService(IContentService contentService) {
		this.contentService = contentService;
	}
	
	@Override
	public JobDetail getJobDetail() {
		return (JobDetail)this;
	}
	
}
